<?php
/**
 * Created by PhpStorm.
 * User: zy-l
 * Date: 2019/6/19
 * Time: 1:23 AM
 */

namespace App\HttpController\Api;

use App\HttpController\Base;
use App\Model\InfoArticle;

/**
 * 获取案例列表
 * Class Infocase
 * @package App\HttpController\Api
 */
class News extends Base
{
    /**
     * 模型
     * @return InfoArticle
     */
    public function getInfoArticleModel()
    {
        return new InfoArticle();
    }

    /**
     *
     */
    public function index()
    {
        $id = $this->getParam('id');
        $where['category_id'] = $id;
        return $this->writeJson('获取数据', $this->getInfoArticleModel()->getAll($this->getInfoArticleModel()->analysisWhere($where),'title,description,up_img'));
    }
}